/**
 * There are <a href="https://www.hdzhx.com">邯郸智讯</a> code generation
 */
package com.boxin.ims.modules.wechat.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.validator.constraints.Length;

import com.thinkgem.jeesite.common.persistence.BaseEntity;
import com.thinkgem.jeesite.modules.sys.entity.User;

/**
 * 调查问卷回答Entity
 * @author XiaoQian
 * @version 2014-05-09
 */
@Entity
@Table(name = "wp_questionnaire_reply")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class QuestionnaireReply extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Long id; 		// 编号
	private QuestionnaireReplyHuman replyHuman;
	private Question question;
	private String answer;
	
	private Date createTime;	// 创建日期

	public QuestionnaireReply() {
		this.createTime = new Date();
	}

	public QuestionnaireReply(Long id){
		this();
		this.id = id;
	}
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	//@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_wechat_questionnaireReply")
	//@SequenceGenerator(name = "seq_wechat_questionnaireReply", sequenceName = "seq_wechat_questionnaireReply")
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}


	@ManyToOne
	@JoinColumn(name="reply_human_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public QuestionnaireReplyHuman getReplyHuman() {
		return replyHuman;
	}

	public void setReplyHuman(QuestionnaireReplyHuman replyHuman) {
		this.replyHuman = replyHuman;
	}

	@NotNull
	public Date getCreateTime() {
		return createTime;
	}

	
	@ManyToOne
	@JoinColumn(name="question_id")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Question getQuestion() {
		return question;
	}

	public void setQuestion(Question question) {
		this.question = question;
	}


	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	
}


